package Cantella::DJabberd::Model::Admin::User::Action::Update;

use Reaction::Class;
use aliased 'Reaction::InterfaceModel::Action::DBIC::Result::Update' => 'DBIC_Update';
#use Reaction::Types::Core qw( NonEmptySimpleStr );

class Update is DBIC_Update, which {

#  has username  => ( is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1 );
#  has full_name => ( is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1 );

  has roles =>
    (
     is  => 'rw',
     isa => 'ArrayRef',
     valid_values => sub {
        shift->target_model->result_source
          ->related_source('user_roles')
            ->related_source('role')->resultset;
     }
    );

};



1;
